<template>
  <div class="other_item_wrap">
    <div>
      <el-form
        :model="commonG6FromObj"
        ref="ruleForm"
        label-width="110px"
        class="demo-ruleForm"
      >
        <el-form-item label="是否使用代理：" prop="isDailli">
          <el-switch v-model="commonG6FromObj.isDailli"></el-switch>
        </el-form-item>
        <el-form-item label="脚本类型：" prop="type">
          <el-select
            v-model="commonG6FromObj.type"
            placeholder="请选择脚本类型"
          >
            <el-option label="数据库资源" value="数据库资源"></el-option>
            <el-option label="FTP资源" value="FTP资源"></el-option>
            <el-option label="代理资源" value="代理资源"></el-option>
            <el-option label="服务器资源" value="服务器资源"></el-option>
            <el-option label="kafka资源" value="kafka资源"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="选择操作方式：" prop="caozuo">
          <el-select
            v-model="commonG6FromObj.caozuo"
            placeholder="请选择操作方式"
          >
            <el-option label="编写脚本运行" value="编写脚本运行"></el-option>
            <el-option label="手动运行" value="手动运行"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="执行路径：" prop="lujing">
          <input type="file" ref="file" id="file" @change="upload" hidden />
          <el-input placeholder="请输入内容" v-model="commonG6FromObj.lujing">
            <el-button
              slot="append"
              icon="el-icon-more"
              type="success"
              @click="btnChange"
            ></el-button>
          </el-input>
        </el-form-item>
        <el-form-item label="执行参数：" prop="canshu">
          <el-input v-model="commonG6FromObj.canshu"></el-input>
        </el-form-item>
        <el-form-item label="脚本内容：" prop="desc">
          <el-input type="textarea" v-model="commonG6FromObj.desc"></el-input>
        </el-form-item>

        <el-form-item label="备注" prop="beizhu">
          <el-input type="textarea" v-model="commonG6FromObj.beizhu"></el-input>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    commonG6FromObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    btnChange() {
      this.$refs.file.click();
    },
    upload() {
      this.commonG6FromObj.lujing = this.$refs.file.value;
    },
  },
};
</script>
<style scoped lang="scss"></style>
